package org.lora.biz.ou.service;

import java.util.List;
import java.util.Map;

import org.lora.biz.ou.entity.Employee;
import org.lora.biz.ou.entity.EmployeeIdentity;
import org.lora.biz.ou.entity.EmployeeIdentityView;
import org.lora.biz.ou.entity.Position;
import org.lora.biz.ou.exception.LoraOrgUserException;
import org.lora.core.mybatis.OrderByBean;
import org.lora.core.mybatis.Page;

/**
 * <p>
 * 类名:IEmployeeIdentityService
 * </p>
 * 描述:人员身份接口<br>
 * 创建时间:2016年9月20日 下午3:14:16<br>
 * 
 * @author Bladnir@outlook.com<br>
 *         修改历史:<br>
 *         2016年9月20日 Bladnir 创建<br>
 */
public interface IEmployeeIdentityService {

	/**
	 * 获取人员列表
	 * 
	 * @param domainId
	 * @param parameterMap
	 * @param page
	 * @param orderByList
	 * @return
	 * @throws LoraOrgUserException
	 * @throws Exception
	 */
	public List<Employee> getEmployeeList(String domainId, Map<String, Object> parameterMap, Page page, List<OrderByBean> orderByList)
			throws LoraOrgUserException;

	/**
	 * 获取人员数量
	 * 
	 * @param domainId
	 * @param parameterMap
	 * @return
	 * @throws LoraOrgUserException
	 * @throws Exception
	 */
	public int getEmployeeCount(String domainId, Map<String, Object> parameterMap) throws LoraOrgUserException;

	/**
	 * 获取职务列表
	 * 
	 * @param domainId
	 * @param parameterMap
	 * @param page
	 * @param orderByList
	 * @return
	 * @throws LoraOrgUserException
	 */
	public List<Position> getPositionList(String domainId, Map<String, Object> parameterMap, Page page, List<OrderByBean> orderByList)
			throws LoraOrgUserException;

	/**
	 * 获取职务数量
	 * 
	 * @param domainId
	 * @param parameterMap
	 * @return
	 * @throws LoraOrgUserException
	 */
	public int getPositionCount(String domainId, Map<String, Object> parameterMap) throws LoraOrgUserException;

	/**
	 * 保存人员实体
	 * 
	 * id字段如果有值 就根据id字段更新. 如果id字段没有值 就生成一个id然后插入数据库.
	 * 
	 * @param employee
	 * @return
	 * @throws LoraOrgUserException
	 */
	public int saveEmployee(Employee employee) throws LoraOrgUserException;

	/**
	 * 获取身份详细信息数量
	 * 
	 * @param domainId
	 * @param parameterMap
	 * @return
	 * @throws LoraOrgUserException
	 */
	public int getEmployeeIdentityDetailCount(String domainId, Map<String, Object> parameterMap) throws LoraOrgUserException;

	/**
	 * 获取身份详细信息列表
	 * 
	 * @param domainId
	 * @param parameterMap
	 * @param page
	 * @param orderByList
	 * @return
	 * @throws LoraOrgUserException
	 */
	public List<EmployeeIdentityView> getEmployeeIdentityDetailList(String domainId, Map<String, Object> parameterMap, Page page,
			List<OrderByBean> orderByList) throws LoraOrgUserException;

	/**
	 * 保存人员身份实体
	 * 
	 * id字段如果有值 就根据id字段更新. 如果id字段没有值 就生成一个id然后插入数据库.
	 * 
	 * @param employeeIdentity
	 * @return
	 * @throws LoraOrgUserException
	 */
	public int saveEmployeeIdentity(EmployeeIdentity employeeIdentity) throws LoraOrgUserException;

	/**
	 * 用于自动补全查询用的方法
	 * 
	 * @param domainId
	 * @param page
	 * @param keyword
	 * @param orderByList
	 * @return
	 * @throws LoraOrgUserException
	 */
	public List<EmployeeIdentityView> getEmployeeIdentityDetailForComplete(String domainId, Page page, String keyword,
			List<OrderByBean> orderByList) throws LoraOrgUserException;
	
	/**
	 * 根据身份ID和域ID 获取身份实体
	 * 
	 * @param domainId
	 * @param eiId
	 * @return
	 * @throws LoraOrgUserException
	 */
	public EmployeeIdentity getEmployeeIdentityById(String domainId,String eiId)throws LoraOrgUserException;

}
